package testObj;

import java.util.HashMap;

/**
 * @author 597983
 * HOW TO USE XML Parser
 * As shown by the Driver, the methods will require the XML String and teh file location the XML to be written to.
 * Use Parse1.parseXML on a hashmap in order to fill the object.
 */
public class Driver {

	public static void main(String[] args) {
		
		
		String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<PERSON_BASIC_SYNC>\n<FieldTypes>\n<PERSON class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<PER_ORG type=\"CHAR\"/>\n<POI_TYPE type=\"CHAR\"/>\n<BIRTHDATE type=\"DATE\"/>\n<BIRTHPLACE type=\"CHAR\"/>\n<BIRTHCOUNTRY type=\"CHAR\"/>\n<BIRTHSTATE type=\"CHAR\"/>\n<DT_OF_DEATH type=\"DATE\"/>\n<LAST_CHILD_UPDDTM type=\"DATE\"/>\n</PERSON>\n<ADDRESSES class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<ADDRESS_TYPE type=\"CHAR\"/>\n<EFFDT type=\"DATE\"/>\n<EFF_STATUS type=\"CHAR\"/>\n<COUNTRY type=\"CHAR\"/>\n<ADDRESS1 type=\"CHAR\"/>\n<ADDRESS2 type=\"CHAR\"/>\n<ADDRESS3 type=\"CHAR\"/>\n<ADDRESS4 type=\"CHAR\"/>\n<CITY type=\"CHAR\"/>\n<NUM1 type=\"CHAR\"/>\n<NUM2 type=\"CHAR\"/>\n<HOUSE_TYPE type=\"CHAR\"/>\n<ADDR_FIELD1 type=\"CHAR\"/>\n<ADDR_FIELD2 type=\"CHAR\"/>\n<ADDR_FIELD3 type=\"CHAR\"/>\n<COUNTY type=\"CHAR\"/>\n<STATE type=\"CHAR\"/>\n<POSTAL type=\"CHAR\"/>\n<GEO_CODE type=\"CHAR\"/>\n<IN_CITY_LIMIT type=\"CHAR\"/>\n<ADDRESS1_AC type=\"CHAR\"/>\n<ADDRESS2_AC type=\"CHAR\"/>\n<ADDRESS3_AC type=\"CHAR\"/>\n<CITY_AC type=\"CHAR\"/>\n<REG_REGION type=\"CHAR\"/>\n<LASTUPDDTTM type=\"DATETIME\"/>\n<LASTUPDOPRID type=\"CHAR\"/>\n</ADDRESSES>\n<NAMES class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<NAME_TYPE type=\"CHAR\"/>\n<EFFDT type=\"DATE\"/>\n<EFF_STATUS type=\"CHAR\"/>\n<COUNTRY_NM_FORMAT type=\"CHAR\"/>\n<NAME type=\"CHAR\"/>\n<NAME_INITIALS type=\"CHAR\"/>\n<NAME_PREFIX type=\"CHAR\"/>\n<NAME_SUFFIX type=\"CHAR\"/>\n<NAME_ROYAL_PREFIX type=\"CHAR\"/>\n<NAME_ROYAL_SUFFIX type=\"CHAR\"/>\n<NAME_TITLE type=\"CHAR\"/>\n<LAST_NAME_SRCH type=\"CHAR\"/>\n<FIRST_NAME_SRCH type=\"CHAR\"/>\n<LAST_NAME type=\"CHAR\"/>\n<FIRST_NAME type=\"CHAR\"/>\n<MIDDLE_NAME type=\"CHAR\"/>\n<SECOND_LAST_NAME type=\"CHAR\"/>\n<SECOND_LAST_SRCH type=\"CHAR\"/>\n<NAME_AC type=\"CHAR\"/>\n<PREF_FIRST_NAME type=\"CHAR\"/>\n<PARTNER_LAST_NAME type=\"CHAR\"/>\n<PARTNER_ROY_PREFIX type=\"CHAR\"/>\n<LAST_NAME_PREF_NLD type=\"CHAR\"/>\n<NAME_DISPLAY type=\"CHAR\"/>\n<NAME_FORMAL type=\"CHAR\"/>\n<LASTUPDDTTM type=\"DATETIME\"/>\n<LASTUPDOPRID type=\"CHAR\"/>\n</NAMES>\n<EMAIL_ADDRESSES class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<E_ADDR_TYPE type=\"CHAR\"/>\n<EMAIL_ADDR type=\"CHAR\"/>\n<PREF_EMAIL_FLAG type=\"CHAR\"/>\n</EMAIL_ADDRESSES>\n<PERSONAL_PHONE class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<PHONE_TYPE type=\"CHAR\"/>\n<COUNTRY_CODE type=\"CHAR\"/>\n<PHONE type=\"CHAR\"/>\n<EXTENSION type=\"CHAR\"/>\n<PREF_PHONE_FLAG type=\"CHAR\"/>\n</PERSONAL_PHONE>\n<PERS_NID class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<COUNTRY type=\"CHAR\"/>\n<NATIONAL_ID_TYPE type=\"CHAR\"/>\n<NATIONAL_ID type=\"CHAR\"/>\n<SSN_KEY_FRA type=\"CHAR\"/>\n</PERS_NID>\n<NAME_TYPE_VW class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<NAME_TYPE type=\"CHAR\"/>\n<ORDER_BY_SEQ type=\"NUMBER\"/>\n</NAME_TYPE_VW>\n<ADDRESS_TYPE_VW class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<ADDRESS_TYPE type=\"CHAR\"/>\n<ORDER_BY_SEQ type=\"NUMBER\"/>\n</ADDRESS_TYPE_VW>\n<PERS_DATA_EFFDT class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<EFFDT type=\"DATE\"/>\n<MAR_STATUS type=\"CHAR\"/>\n<MAR_STATUS_DT type=\"DATE\"/>\n<SEX type=\"CHAR\"/>\n<HIGHEST_EDUC_LVL type=\"CHAR\"/>\n<FT_STUDENT type=\"CHAR\"/>\n<LANG_CD type=\"CHAR\"/>\n<ALTER_EMPLID type=\"CHAR\"/>\n<LASTUPDDTTM type=\"DATETIME\"/>\n<LASTUPDOPRID type=\"CHAR\"/>\n</PERS_DATA_EFFDT>\n<PERS_DATA_USA class=\"R\">\n<EMPLID type=\"CHAR\"/>\n<EFFDT type=\"DATE\"/>\n<US_WORK_ELIGIBILTY type=\"CHAR\"/>\n<MILITARY_STATUS type=\"CHAR\"/>\n<CITIZEN_PROOF1 type=\"CHAR\"/>\n<CITIZEN_PROOF2 type=\"CHAR\"/>\n<MEDICARE_ENTLD_DT type=\"DATE\"/>\n</PERS_DATA_USA>\n<PSCAMA class=\"R\">\n<LANGUAGE_CD type=\"CHAR\"/>\n<AUDIT_ACTN type=\"CHAR\"/>\n<BASE_LANGUAGE_CD type=\"CHAR\"/>\n<MSG_SEQ_FLG type=\"CHAR\"/>\n<PROCESS_INSTANCE type=\"NUMBER\"/>\n<PUBLISH_RULE_ID type=\"CHAR\"/>\n<MSGNODENAME type=\"CHAR\"/>\n</PSCAMA>\n</FieldTypes>\n<MsgData>\n<Transaction>\n<PERSON class=\"R\">\n<EMPLID IsChanged=\"Y\">K0G004</EMPLID>\n<PER_ORG IsChanged=\"Y\">EMP</PER_ORG>\n<POI_TYPE/>\n<BIRTHDATE IsChanged=\"Y\">1954-03-20</BIRTHDATE>\n<BIRTHPLACE/>\n<BIRTHCOUNTRY/>\n<BIRTHSTATE/>\n<DT_OF_DEATH/>\n<LAST_CHILD_UPDDTM IsChanged=\"Y\">2005-05-09</LAST_CHILD_UPDDTM>\n<PERSONAL_PHONE class=\"R\">\n<EMPLID IsChanged=\"Y\">K0G004</EMPLID>\n<PHONE_TYPE IsChanged=\"Y\">CELL</PHONE_TYPE>\n<COUNTRY_CODE/>\n<PHONE IsChanged=\"Y\">417-8766</PHONE>\n<EXTENSION/>\n<PREF_PHONE_FLAG IsChanged=\"Y\">Y</PREF_PHONE_FLAG>\n</PERSONAL_PHONE>\n<PSCAMA class=\"R\">\n<AUDIT_ACTN>C</AUDIT_ACTN>\n<AUDIT_ACTN>A</AUDIT_ACTN>\n<AUDIT_ACTN>D</AUDIT_ACTN>\n</PSCAMA>\n</PERSON>\n<PSCAMA class=\"R\">\n<LANGUAGE_CD>ENG</LANGUAGE_CD>\n\n<BASE_LANGUAGE_CD>ENG</BASE_LANGUAGE_CD>\n<MSG_SEQ_FLG/>\n<PROCESS_INSTANCE>0</PROCESS_INSTANCE>\n<PUBLISH_RULE_ID/>\n<MSGNODENAME/>\n</PSCAMA>\n</Transaction>\n</MsgData>\n</PERSON_BASIC_SYNC>";
		HashMap<String, Object>lol = new HashMap();	
		lol = Parse1.parseXML(xml,"C:\\Users\\597983\\Desktop\\SAIT_IT_SD\\Capstone Project\\Project\\XML_TEST\\xml\\test_1.xml");
		
		System.out.println("Driver ToString: "+lol.toString());
	}

}
